/*
  Copyright (c) 2009-10 by kRaw1er & HierOS
  This file is part of M8J project
*/
#pragma once

#include <mzfc_inc.h>
#include <acc_api.h>

#include <vector>

#include "typedefs.h"
#include "CChatList.h"
#include "CSingleLineEdit.h"
#include "gloox\messagehandler.h"

#define TASK_BAR_HEIGHT									36

#define MZ_IDC_EDIT										202
#define MZ_IDC_CHAT_LIST								204
#define MZ_IDC_TOOLBAR									201

class CM8JMainWnd;

class CChatWnd : public CMzWndEx, public MessageHandler
{
public:
	CChatList m_ChatList;
	CSingleLineEdit m_Edit;
	UiCaption m_Caption;
	UiToolbar_Text m_Toolbar;
	std::string m_Jid;

	CChatWnd(CM8JMainWnd * parent);
	~CChatWnd();
	virtual BOOL OnInitDialog();
	virtual LRESULT MzDefWndProc(UINT message, WPARAM wParam, LPARAM lParam);
	virtual void OnMzCommand(WPARAM wParam, LPARAM lParam);

	//*******************************************************************************
	// Message handler
	virtual void handleMessage(Stanza * stanza, MessageSession * session);
	//********************************************************************************

	void ScreenRotate(int RotateMode);
	void SetMessages(const std::string &jid, Messages * pMessages);
	void OnSendMessage();
	void ResizeChatList(RECT rc, bool focused);

private:
	DWORD m_AccMessage;
	DWORD m_CurrentScreenRotation;
	Messages * m_Messages;
	CM8JMainWnd * m_Parent;
};
